package com.csr;

import java.io.IOException;

import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.ResponseHandler;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.BasicResponseHandler;
import org.apache.http.impl.client.DefaultHttpClient;

import android.util.Log;

public class HttpConn 
{
	public String createHttpConn(String URL)
	{
		String result = null;
		HttpClient httpclient=null;
		
    	try 
    	{
    	    System.out.println("url-->is"+URL);
    	    httpclient= new DefaultHttpClient();
    	    HttpGet request = new HttpGet(URL);
   	    	// request.addHeader("deviceId", deviceId);
    	    ResponseHandler<String> handler = new BasicResponseHandler();
    		result = httpclient.execute(request, handler);
    		return result;
    	}
    	catch (Exception e)
    	{
    		e.printStackTrace();
    		return result;
    	} 
    	
    	finally
    	{
    		httpclient.getConnectionManager().shutdown();
    	} 
	}
}	
